<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>报错记录</title>
    <link rel="stylesheet" href="">
</head>
<style type="text/css" media="screen">
h2 {
    text-align: center;
    font-family: Courier, Consolas;
}

hr {
    margin: 2rem 0;
    width: 1400px;
}

main {
    font-family: Courier, Consolas;
    font-size: 29px;
}

ol {
    transform: rotateY(45deg);
    width: 85%;
    font-family: Courier, Consolas;
}

p {
    font-family: Courier, Consolas;
    color: blue;
}

textarea {
    font-family: Courier, Consolas;
    /*cursor: not-allowed;*/
    width: 76em;
    height: 80em;
    font-size: 1rem;
    background: antiquewhite;
}
</style>

<body>
    <header></header>
    <main>
        <div>
            <h2>遇到过的报错(非业务逻辑方面)</h2>
            <ol>
                <li>Caused by:
                    org.springframework.beans.factory.NoSuchBeanDefinitionException: No
                    qualifying bean of type 'com.allstar.spring.mapper.TAccountMapper'
                    available: expected at least 1 bean which qualifies as autowire
                    candidate. Dependency annotations:
                    {@org.springframework.beans.factory.annotation.Autowired(required=true)}
                    <p>strategy: pom.mybatis-spring-boot-starter.version==1.3.2</p>
                </li>
                <hr>
                <li>Caused by:
                    org.springframework.beans.factory.UnsatisfiedDependencyException:
                    Error creating bean with name 'TAccountServiceImpl': Unsatisfied
                    dependency expressed through field 'baseMapper'; nested exception
                    is org.springframework.beans.factory.NoSuchBeanDefinitionException:
                    No qualifying bean of type
                    'com.allstar.spring.mapper.TAccountMapper' available: expected at
                    least 1 bean which qualifies as autowire candidate. Dependency
                    annotations:
                    {@org.springframework.beans.factory.annotation.Autowired(required=true)}
                </li>
                <hr>
                <li>Caused by:
                    org.springframework.beans.factory.BeanCreationException: Error
                    creating bean with name 'TAccountMapper' defined in file
                    [/home/admin/workspace/eclipse/eclipse-workspace/attendance/target/classes/com/allstar/spring/mapper/TAccountMapper.class]:
                    Invocation of init method failed; nested exception is
                    java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or
                    'sqlSessionTemplate' are required</li>
                <hr>
                <li>Caused by: java.lang.IllegalArgumentException: Property
                    'sqlSessionFactory' or 'sqlSessionTemplate' are required</li>
                <hr>
                <li>org.apache.ibatis.binding.BindingException: Invalid bound
                    statement (not found):
                    com.allstar.spring.mapper.TAccountMapper.selectOne
                    <p>
                        strategy:<br>
                        1.com.allstar.spring.configur.MyBatisPlusConfiguration
                        2.resource=>yml=>mybatis-plus
                    </p>
                </li>
                <hr>
                <li>org.springframework.dao.DataAccessResourceFailureException:
                    ### Error querying database. Cause:
                    java.sql.SQLSyntaxErrorException: Schema 'SA' does not exist ###
                    The error may exist in
                    com/allstar/spring/mapper/TAccountMapper.java (best guess) ### The
                    error may involve
                    com.allstar.spring.mapper.TAccountMapper.selectOne ### The error
                    occurred while executing a query ###
                    SQL: <p>SELECT
                        id,employeeName,bornTime,regTime,phone,mailbox,portrait,region,department,role,employeeNum,password,salt</p>
                    FROM t_account WHERE employee_num = ? ### Cause:
                    java.sql.SQLSyntaxErrorException: Schema 'SA' does not exist ;
                    Schema 'SA' does not exist; nested exception is
                    java.sql.SQLSyntaxErrorException: Schema 'SA' does not exist
                    <p>
                        strategy:Using Spring Boot 1.4.2 in combination with
                        auto-generated data sources for a<b> Derby </b>EmbeddedDatabase
                        provokes "Schema '' does not exist" exceptions when auto-creating
                        and executing the DDL towards<b> Derby</b>.
                    </p>
                </li>
                <hr>
                <li>java.sql.SQLNonTransientConnectionException: Public Key
                    Retrieval is not allowed.
                    <p>strategy:yml=>jdbc=>allowPublicKeyRetrieval=true</p>
                </li>
                <hr>
                <li>org.springframework.jdbc.BadSqlGrammarException: ### Error
                    querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown
                    column 'employeeName' in 'field list' ### The error may exist in
                    com/allstar/spring/mapper/TAccountMapper.java (best guess) ### The
                    error may involve defaultParameterMap ### The error occurred while
                    setting parameters ### <b>SQL: SELECT
                        id,employeeName,bornTime,regTime,phone,mailbox,portrait,region,department,role,employeeNum,password,salt
                        FROM t_account WHERE employee_num = ? </b>### Cause:
                    java.sql.SQLSyntaxErrorException: Unknown column 'employeeName' in
                    'field list' ; bad SQL grammar []; nested exception is
                    java.sql.SQLSyntaxErrorException: Unknown column 'employeeName' in
                    'field list'
                    <p>
                        strategy: <br>
                        com.allstar.spring.configur.MyBatisPlusConfiguration.mybatisSqlSessionFactoryBean()<br>=>setMapUnderscoreToCamelCase(true)
                    </p>
                </li>
                <hr>
                <li>SLF4J: Class path contains multiple SLF4J bindings. SLF4J:
                    Found binding in
                    [jar:file:/D:/Users/xxx/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]
                    SLF4J: Found binding in
                    [jar:file:/D:/Users/xxx/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
                    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an
                    explanation. SLF4J: Actual binding is of type
                    [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
                    <p>
                        strategy:<br>
                        <textarea readonly="readonly">
1.<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
            <!-- exclusion(排除之义): 解决无法生成log4j2日志文件 -->
            <exclusions>
                <exclusion>
                    <artifactId>logback-classic</artifactId>
                    <groupId>ch.qos.logback</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>log4j-over-slf4j</artifactId>
                    <groupId>org.slf4j</groupId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

<!-- -------------- -->
<!-- starter log4j2 -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-log4j2</artifactId>
        </dependency>
        <!--log4j2核心包 -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>2.9.1</version><!--$NO-MVN-MAN-VER$ -->
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>2.9.1</version><!--$NO-MVN-MAN-VER$ -->
        </dependency>
        <!-- Web项目需添加 -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-web</artifactId>
            <version>2.9.1</version><!--$NO-MVN-MAN-VER$ -->
        </dependency>
        <!--用于与slf4j保持桥接 -->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-slf4j-impl</artifactId>
            <version>2.9.1</version><!--$NO-MVN-MAN-VER$ -->
        </dependency>
        <!-- slf4j核心包 -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version><!--$NO-MVN-MAN-VER$ -->
        </dependency>
</textarea>
                    </p>
                </li>
                <hr>
                <li>tomcat启动失败,information: <textarea style="height: 14em;">
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019/12/10 19:36:09.011 [main] ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

Description:

Failed to bind properties under 'mybatis.configuration.result-maps[0]' to org.apache.ibatis.mapping.ResultMap:

    Reason: Failed to extract parameter names for org.apache.ibatis.mapping.ResultMap(org.apache.ibatis.mapping.ResultMap$1)
Action:

Update your application's configuration
</textarea>
                    <p>
                        strategy(主要是第一步):<br>
                        1.resources下建立spring.properties,增加配置spring.jndi.ignore=true <br>
                        <br> 2.
                        <div>@EnableTransactionManagement @MapperScan(basePackages =
                            {"com.allstar.spring.mapper"})
                            @SpringBootApplication(scanBasePackages = { "com.allstargh.spring"
                            }) class EnterpriseApplication extends
                            SpringBootServletInitializer</div> <br>
                        <div>
                            <b>Reason:</b> <br>
                            <p>
                                与spring-boot2.2.0兼容性有关,暂时只出现在部署war启动出错,另外mybatis-spring-boot-starter这个是mybatis原生的,也未支持2.2.0.</p>
                        </div>
                    </p>
                </li>
                <hr>
                <li>启动成功,但访问url报404
                    <p>strategy:使用thymeleaf</p>
                </li>
                <hr>
                <li>Resolved
                    [org.springframework.http.converter.HttpMessageNotReadableException:
                    Required request body is missing: public
                    com.allstar.spring.notation.Json<com.allstar.spring.entity.TAccount>
                        com.allstar.spring.controller.TAccountController.loginAction
                        <br>
                        (javax.servlet.http.HttpSession,java.lang.String,java.lang.String)]
                        <p></p>
                </li>
                <hr>
                <li>Resolved
                    [org.springframework.http.converter.HttpMessageNotReadableException:
                    JSON parse error: Cannot deserialize instance of
                    `java.lang.Integer` out of START_OBJECT token; nested exception is
                    com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot
                    deserialize instance of `java.lang.Integer` out of START_OBJECT
                    token at [Source: (PushbackInputStream); line: 1, column: 1]]
                    <p></p>
                </li>
                <hr>
                <li>
                    0:
                    Caused by: io.lettuce.core.RedisCommandTimeoutException: Command timed out after no timeout
                    <br>
                    1:
                    org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after no timeout
                    <p>
                        解决:<br>
                        applications.yaml:<br>
                        spring:<br>
                        redis:<br>
                        timeout: 3000 #设置连接超时大于0,最好在1000以上
                    </p>
                </li>
                <hr>
                <li>
                    java.lang.NullPointerException: null
                    at com.allstar.spring.service.impl.TAccountServiceImpl.uploadAvatar(TAccountServiceImpl.java:397)
                    <p>问题:request跨域获取session失效
                        <br>
                        建议:<br>
                        如果你的session是存在进程中，那么session是无法这样跨程序调用的。
                        你这个端口不一样（等价于两个域名），所以cookie也无法使用。
                        这种场景，建议你使用token，或者把session存储在redis中。
                    </p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
                <li>
                    <p></p>
                </li>
                <hr>
            </ol>
        </div>
    </main>
    <footer> </footer>
</body>

</html>